1. Technical Field
The present invention is directed to an apparatus and method for enabling composite style sheet application to multi-part electronic documents.
2. Description of Related Art
A “style sheet” is a specification of a style that is to be used when presenting a document. The style specification includes information such as the font and margins to be used, the formatting layout, and other types of information that indicate how the presented document should appear. Style sheets can be used for many types of presentation of a document, including printing the document, displaying it on a video display, processing the document by a speech synthesizer, etc. Consequently, style sheets may also be utilized to describe transformations from one document type to another (e.g. from MathML to HTML) or as filters which describe transformations to reduce the amount of content while maintaining the original document type.
One type of style sheet is an XSL Style Sheet. XSL Style Sheets are style sheets specified in the eXtensible Stylesheet Language (XSL). An XSL Style Sheet specifies how an eXtensible Markup Language (XML) document is to be transformed for presentation, resulting in a different document which may or may not maintain the original document type. XML is a standardized formatting notation, created for structured document interchange on the World Wide Web (hereinafter, “Web”). (Refer to “Extensible Markup Language (XML), W3C Recommendation 10-Feb.-1998” which is available on the World Wide Web at http://www.w3.org/TR/1998/REC-xml-19980210, for more information on XML; and to “Extensible Stylesheet Language (XSL), Version 1.0, World Wide Web Consortium Working Draft 16-Dec.-1998”, hereinafter “XSL Specification”, which is available on the Web at http://www.w3.org/TR/WD-xsl, for more information on XSL.)
Style sheets include “template rule” constructs, which define an input pattern and a template (also known as an “action”) to use in creating an output result tree fragment. When applying a style sheet, the patterns in the templates are matched against the syntax of the source document. When a match is found with the template pattern, an output document fragment is created according to the actions specified in the template (which may include processing additional elements in the source document beyond the matching element). The source document is parsed recursively, until no more matching patterns are found. The resulting document fragments are then aggregated to yield a complete output document. (For more information on this process, refer to section 2, “Tree Construction”, in the XSL Specification.) It is this template matching and substitution of different document elements according to the actions in the matching rules that enables style sheets to transform documents.
While the term “document” is used herein when discussing encoded data and application of style sheets thereto, it is to be understood that the information on which a style sheet operates may represent any type of information, and is not limited to the traditional interpretation of the word “document”.
As one example, a style sheet may be used to process an encoded representation of records from a data repository which specify a company's sales data. As another example, a style sheet may be used to format employee information retrieved from a corporate database for presentation. For ease of reference, the term “document” will be used herein to refer to these diverse types of information.
XML is emerging as a powerful methodology for representing document content, due to its ability to store data in a self-defining, portable manner. A large number of XML-based markup languages have recently emerged. XML-based markup languages have been utilized to represent airline reservation information, weather information, news information, vertical industry and internal company data content, and the like. Examples of recently defined markup languages include Channel Definition Format (CDF), trading partner agreement Markup Language (tpaML) and content Synchronization Markup Language (SynchML).
Style sheet languages such as XSL, along with their associated processors, are powerful tools for filtering data content encoded in notations such as XML, as well as for formatting XML-based documents into a variety of rendering markup languages, such as HyperText Markup Language (HTML), Wireless Markup Language (WML), Handheld Device Markup Language (HDML) and Voice-XML. For example, style sheets may be written to search for and extract a specific subset of the information contained in the XML document. In addition, a style sheet might tailor the information so that it can be delivered to a particular device, transforming the document for the characteristics of the device (such as which browser will be used to render the document, the screen size of the device, whether the screen supports color or gray scale, etc.).
The need to perform this type of content tailoring is increasing rapidly as the popularity of new types of computing devices, such as pervasive computing devices, increases. Pervasive computing devices are typically small, constrained-storage devices such as “Smart Phones” or the WorkPad device from the International Business Machines Corporation (IBM). (“WorkPad” is a registered trademark of IBM.) These devices are typically designed to be portable, and therefore are often connected to a network using a relatively expensive wireless connection, which may have limited bandwidth.
Pervasive computing devices are often quite different from the devices an end-user might use in an office setting, such as a desktop computer. For example, the display screen on the devices may be quite small, and may not support color display, audio, etc. Thus, XML documents which were originally created with the expectation that the document would be rendered on a full-function desktop computer may contain a significant amount of content that cannot be presented to the user of the smaller, low-end device. In fact, when a document includes large objects such as image, video, or audio files, it is quite possible that the low-end device will not have sufficient storage space to even receive the document.
As the number of XML-based content markup languages proliferates, and the desire of companies to provide personalized portal sites increases, XML transcoding developers are being required to create a much larger number of style sheets than were required in their non-portal based projects. This explosion in the number of stylesheets required to be written is due to the fact that for each desired subset combination of XML-based content streams that one desires to transcode, a specific style sheet must be created.
For example, suppose a portal site provides content for news, sports, weather and stocks. Now suppose one group of users only desires news, sports and stocks and another group of users desires news, weather and stocks. In order to support both of these groups of users, a separate stylesheet needs to be created for each group. Moreover, each group may make use of many different types of devices on which to receive this content. Thus, the portal site must have a style sheet for each group for each device or a very large parameterized stylesheet needs to be created (also typically done on a per device basis).
Both of the above approaches result in a proliferation of style sheets that are monolithic in nature, not very modular, and poorly suited to extensibility. For example, suppose after a group for news, sports and stocks is created and a group for news, weather and stocks is created, a new XML datastream providing company highlights is desired to be added to the groups. To provide this new XML datastream, a developer must go back and look at the formerly created style sheets and augment these style sheets to support the new datastream. Such an approach is extremely time consuming, costly, and could result in introducing sources of error into the legacy style sheets.
Thus, it would be beneficial to have an apparatus and method for creating simple style sheets that describe standard subsets of content which can be combined into a composite style sheet for a desired datastream.